const http=require('http')
const server=http.createServer((req,res)=>{
    // res.end('hello proxy')
    // 向超超的后端发送请求，拿到数据返回给我前端
    res.writeHead(200,{'Access-Control-Allow-Origin':'http://192.168.1.75:3000'})

    http.request({
        host:'192.168.1.75',
        port:'3000',
        path:'/',
        method:'GET',
        headers:{}
    },(proxyRes)=>{
       proxyRes.on('data',(data)=>{
          console.log(data.toString())
          res.end(data.toString())
       })
    }).end()
    
})
server.listen(3000,()=>{
    console.log('server is running at http://localhost:3000')
})
